<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0px;
            margin: 0px;
        }

        div {
            width: 200px;
            height: 300px;
            position: absolute;
            display: none;
        }

        ul {
            list-style: none;
            border-radius: 5px;
            border: solid black 2px;
        }

        li {
            color: blue;
            width: 200px;
            height: 50px;
            line-height: 50px;
            text-align: left;
        }

        li:hover {
            color: black;
            background-color: blue;
        }
    </style>
</head>

<body>
    <div>
        <ul>
            <li>单杀faker</li>
            <li>单杀showmaker</li>
            <li>击毙simple</li>
            <li>获得iphone19pro</li>
            <li>晚上我请客</li>
            <li>醒了</li>
        </ul>
    </div>
    <script>
        var box = document.querySelector("div")
        document.oncontextmenu = function (e) {
            var e = e || window.event;
            e.preventDefault()
            var x = e.clientX
            var y = e.clientY
            box.style.display = "block"
            box.style.top = y + "px"
            box.style.left = x + "px"
        }
        document.onclick = function (e) {
            box.style.display = "none"
        }
    </script>
</body>

</html>